/**
 * @param {number[]} nums
 * @return {boolean}
 */
var increasingTriplet = function(nums) {
  if(nums.length < 3)
    return false;
  let min = (2 ** 31) - 1, secondMin = (2 ** 31) - 1;
  for(let i = 0; i < nums.length; i++) {
    if(nums[i] <= min) {
      min = nums[i];
    } else if(nums[i] <= secondMin) {
      secondMin = nums[i];
    } else {
      return true;
    }
  }
  return false;
};
let nums = [1,2,3,4,5];
console.log(increasingTriplet(nums));
nums = [5,4,3,2,1];
console.log(increasingTriplet(nums));
nums = [2,1,5,0,4,6];
console.log(increasingTriplet(nums));
